import os

cmdStream=os.popen("py -m jupyter lab F:\save\note --port=8888")
for i in range(10):print()
cmdIter=iter(cmdStream)
#cmdout=""
#for i in cmdIter:cmdout+=i

filePath="G:/Desktop_back/Desktop/test.txt"
f=open(filePath,"w")
f.write(next(cmdIter))
f.close()